package com.ruoyi.project.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.mapper.SysLocationMapper;
import com.ruoyi.project.system.domain.SysLocation;
import com.ruoyi.project.system.service.ISysLocationService;

/**
 * 收货地址Service业务层处理
 * 
 * @author theme
 * @date 2021-01-20
 */
@Service
public class SysLocationServiceImpl implements ISysLocationService 
{
    @Autowired
    private SysLocationMapper sysLocationMapper;

    /**
     * 查询收货地址
     * 
     * @param id 收货地址ID
     * @return 收货地址
     */
    @Override
    public SysLocation selectSysLocationById(String id)
    {
        return sysLocationMapper.selectSysLocationById(id);
    }

    /**
     * 查询收货地址列表
     * 
     * @param sysLocation 收货地址
     * @return 收货地址
     */
    @Override
    public List<SysLocation> selectSysLocationList(SysLocation sysLocation)
    {
        return sysLocationMapper.selectSysLocationList(sysLocation);
    }

    /**
     * 新增收货地址
     * 
     * @param sysLocation 收货地址
     * @return 结果
     */
    @Override
    public int insertSysLocation(SysLocation sysLocation)
    {
        sysLocation.setCreateTime(DateUtils.getNowDate());
        return sysLocationMapper.insertSysLocation(sysLocation);
    }

    /**
     * 修改收货地址
     * 
     * @param sysLocation 收货地址
     * @return 结果
     */
    @Override
    public int updateSysLocation(SysLocation sysLocation)
    {
        sysLocation.setUpdateTime(DateUtils.getNowDate());
        return sysLocationMapper.updateSysLocation(sysLocation);
    }

    /**
     * 批量删除收货地址
     * 
     * @param ids 需要删除的收货地址ID
     * @return 结果
     */
    @Override
    public int deleteSysLocationByIds(Long[] ids)
    {
        return sysLocationMapper.deleteSysLocationByIds(ids);
    }

    /**
     * 删除收货地址信息
     * 
     * @param id 收货地址ID
     * @return 结果
     */
    @Override
    public int deleteSysLocationById(Long id)
    {
        return sysLocationMapper.deleteSysLocationById(id);
    }
}
